//this class use poco library thread to implement threadimpl interface
//andycai_sc 2011-04-29

#ifndef BOOSTTHREADIMPL_H
#define BOOSTTHREADIMPL_H

#include <boost/thread.hpp>
#include "GParallel/GThreadImpl.h"

class BoostThreadImpl : public GThreadImpl
{
public:
    BoostThreadImpl(GThread* _thread);
    virtual ~BoostThreadImpl();

    void startImpl();
    void stopImpl();
	void joinImpl();
	void sleepImpl(long mseconds);

private:
    struct Callable
    {
        Callable(GThreadImpl* threadImp);
        ~Callable();

        void operator()();

        GThreadImpl* m_threadImp;
    };

private:
    boost::thread* m_booThread;
};


#endif // BOOSTTHREADIMPL_H
